<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .col-label {
                width: 100px;
                text-align: right;
            }

            .col-label2 {
                width: 200px;
                text-align: right;
            }

            .col-input {
                width: 30px;
            }

            .col_remark {
                width: 100px;
                text-align: right;
            }

            .buttontab {
                margin-top: 15px;
                text-align: center;
            }
        </style>
        <script type="text/javascript" src="#{request.contextPath}/js/jquery-1.6.js"/>
        <script type="text/javascript">
            var Flag = "none";
            function changeRtnFlag(param) {
                Flag = param;
            }
            function rtnScript(rtnflag) {
                if (rtnflag == "true") {
                    alert("操作成功！");
                    window.returnValue = "1";
                    window.close();
                } else {
                    alert("操作失败！");
                    window.returnValue = "0";
                    window.close();
                }
            }
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.getAttribute("id") != 'editForm:btnSave')
                        event.keyCode = 9;
                }
            }
            function form_Init() {
                var arg = window.dialogArguments;
                if (arg) {
                    var operation = arg.doType;
                    if (operation != "add") {
                        if (operation == "select") {
                            $("input").disabled = "true";
                        }
                    }
                }
            }
        </script>
        <base target="_self"/>
    </ui:define>
    <ui:define name="content">
        <div style="margin:5px;">
            <h:messages id="msgs" showDetail="true"/>
            <h:form id="editForm">
                <h:outputText id="rntFlag" escape="false" value="#{accountEditAction.rtnFlag}"/>
                <p:fieldset legend="【监管账户】修改">
                    <h:panelGrid id="detailPanel1" columns="1" cellpadding="3" border="0" style="margin-top: 15px;">
                        <h:panelGrid columns="4" cellpadding="2"
                                     columnClasses="col-label,col-input,col-label2,col-input">

                            <h:outputLabel value="*【房产商】:" for="companyId"/>
                            <h:selectOneMenu id="companyId" value="#{accountEditAction.account.companyId}" style="width:192px;">
                                <f:selectItems value="#{accountEditAction.companyList}"></f:selectItems>
                            </h:selectOneMenu>

                            <h:outputLabel value="*【监管账号】:" for="accountCode"/>
                            <h:inputText autocomplete="off" id="accountCode" style="width:192px;" required="true"
                                         requiredMessage="必须输入监管账号！" value="#{accountEditAction.account.accountCode}">
                            </h:inputText>

                            <h:outputLabel value="*【账户名称】:" for="accountName"/>
                            <p:inputText id="accountName" value="#{accountEditAction.account.accountName}"
                                         style="width:192px;" required="true" requiredMessage="必须输入账户名称！"/>

                            <h:outputLabel value="项目名称:" for="proName"/>
                            <p:inputText id="proName" value="#{accountEditAction.account.proName}"
                                         style="width:192px;"/>

                            <h:outputLabel value="项目地址:" for="proAddr"/>
                            <p:inputText id="proAddr" value="#{accountEditAction.account.proAddr}"
                                         style="width:192px;"/>
                        </h:panelGrid>
                    </h:panelGrid>
                </p:fieldset>
                <p:fieldset legend="操作">
                    <h:panelGrid styleClass="buttontab" columns="1" border="0" width="100%">
                        <h:panelGroup>
                            <h:commandButton id="btnSave" rendered="true"
                                             action="#{accountEditAction.onBtnSaveClick}" value="保存"/>
                            <h:commandButton immediate="true" rendered="true" value="取消"
                                             onclick="window.close();return false;"/>
                        </h:panelGroup>

                    </h:panelGrid>
                </p:fieldset>
            </h:form>
        </div>
    </ui:define>
</ui:composition>